package event;

import editor.NotImplementedException;
import model.code.line.Immediate;
import model.symbol.Constant;

/**
 * @author Neil Dickson
 */
public class ValueChangeEvent extends SymbolChangeEvent {
	private	Immediate	oldValue;
	private	Immediate	newValue;

	public ValueChangeEvent(Constant symbol, Immediate oldValue, Immediate newValue) {
		super(symbol);
		this.oldValue = oldValue;
		this.newValue = newValue;
	}

	public Undoable undo() {
		throw new NotImplementedException("ValueChangeEvent shouldn't be used like an Undoable.");
	}

	public String getDescription() {
		return "Change value of "+symbol.getName()+" from "+oldValue+" to "+newValue;
	}

	public Immediate getOldValue() {
		return oldValue;
	}

	public Immediate getNewValue() {
		return newValue;
	}
}
